<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<base href="<%=basePath%>">
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>更改登录页面背景图片</title>
		<link href="css/css.css" rel="stylesheet" type="text/css" />
	<link href="css/style.css" rel="stylesheet" type="text/css" />
	<style type="text/css">
		<!--
		.atten {font-size:12px;font-weight:normal;color:#F00;}
		-->
	</style>
	<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
	<link rel="stylesheet" type="text/css" href="js/uploadify.css" />
	<script type="text/javascript" src="js/jquery.uploadify.js"></script>
	<script >
		$(function() {
		    $("#file_upload").uploadify({
		    	'auto'     : false,
		    	'fileSizeLimit' : '5MB',
		    	'fileObjName' : 'file_upload',
		    	'fileTypeDesc' : 'bhb',
		    	'fileTypeExts' : '*.gif; *.jpg; *.png',
		    	'buttonText'    : '选择文件',
		        'swf'      : 'js/uploadify.swf',
		        'uploader' : 'admin/upload',
		         'folder'  : 'attached/images',
		        'displayData'    : 'speed',
		        'onUploadSuccess' : function(file, data, response) {
            		alert('The file ' + file.name + ' was successfully uploaded with a response of ' + response + ':' + data);
            		$("#imgMsg").val(data);
        		}
		    });
		});
	</script>
</head>

<body class="ContentBody">
  
	<div class="MainDiv">
	<table width="99%" border="0" cellpadding="0" cellspacing="0" class="CContent">
	  <tr>
	      <th class="tablestyle_title" >更改登录页面背景图片</th>
	  </tr>
 	  <tr>
	    <td class="CPanel">
			<table border="0" cellpadding="0" cellspacing="0" style="width:100%">
				<tr>
					<td width="100%">
						<fieldset style="height:100%;">
						<legend>更改信息</legend>
						<form action="admin/AdsUpdateLoginImg" method="post">
							<table border="0px" cellpadding="2" cellspacing="1" style="width:547px">
								<tr>
									<td colspan="2" width="120px" align="right">添加图片:</td>
									<td width="427px">
									   	<input type="file" name="file_upload" id="file_upload" /><a href="javascript:$('#file_upload').uploadify('upload','*')">上传</a>
									    <input type="hidden" name="imgUrl" id="imgMsg" value=""/>
									</td>
								</tr>
							    <tr>
									<td colspan="3">
										<%--<c:if test="${ requestScope.ads.picSrc == '' }">
											<img src="images/03.gif" width="547px" height="420px"/>
										</c:if>
										<c:if test="${ requestScope.ads.picSrc != '' }">--%>
										<img src="${ requestScope.ads.picSrc }" width="547px" height="420px"/>
										<%--</c:if>--%>
									</td>
							    </tr>
							    <tr>
							       	<td><input type="submit" class="right-button02" value="提交"/></td>
							    </tr>
							</table>
						</form><br/>
						</fieldset>			
					</TD>
				</TR>
				<tr>
					<td>&nbsp;</td>
				</tr>
				</TABLE>
		 	</td>
	  	</tr>
	</TABLE>
</div>
</body>
</html>
